package com.tbs.easyhomemoneyserver.dao

import com.tbs.easyhomemoneyserver.DO.SysUser
import com.tbs.easyhomemoneyserver.dao.providers.SystemUserDaoProvider
import com.tbs.easyhomemoneyserver.form.BaseUserSearchForm
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
import org.apache.ibatis.annotations.SelectProvider
import tk.mybatis.mapper.common.BaseMapper


@Mapper
interface SysUserDao : BaseMapper<SysUser?> {
    @Select("select count(1) from easy_home_money.sys_user where name=#{param1} limit 1")
    fun hasSameUserName(userName: String): Int

    @SelectProvider(type = SystemUserDaoProvider::class, method = "conditionFindSystemUser")
    fun conditionFindSystemUser(baseUserSearchForm: BaseUserSearchForm): List<SysUser>
}
